programming4us
           
 
 
Windows

SOA with .NET and Windows Azure : WCF Discovery (part 1) - Discovery Modes

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
2/16/2011 5:52:44 PM
WS-Discovery is a multicast protocol used to discover services within a network. It provides a standardized means of discovering services at runtime by allowing services to locate other services using UDP multicast messages or via a discovery proxy.

To find a target service, a service consumer sends a probe message to a multicast group. Target services that match the probe then send responses directly to the service consumer informing it of their existence. A service consumer can also look for endpoint address changes if a service’s network location changed.

Version 4.0 of the .NET framework introduced the WCF Discovery extension, a mechanism based on the WS-Discovery industry standard. It enables service redundancy, dynamic load balancing, and even fault tolerance (where if one service fails to respond, another service that satisfies the criteria can be dynamically located).

Being able to discover services dynamically simplifies the maintenance of service dependencies and increases the overall robustness of a service inventory because an alternative to a failed or unavailable service can quickly be located without explicit reconfiguration steps. Dynamic discovery and announcements can also be necessary in highly dynamic scenarios, such as in a dynamic cloud environment where new service instances go online or offline, depending on current usage patterns.

Note

To view the WS-Discovery specification, visit www.soaspecs.com.


Discovery Modes

WCF supports two discovery modes: ad hoc and managed:

  • Ad hoc discovery allows services to locate other services on their local subnet and announce their availability when they go online or offline. Each service on the network can receive and respond to multicast discovery queries for targeted discovery needs.

  • Managed discovery introduces a dedicated discovery proxy into the environment. This proxy manages service availability information and responds to discovery queries to reduce the overall network traffic related to discovery announcements and queries and further allows for the discovery of services available outside the local subnet.

All classes related to the WS-Discovery protocol are encapsulated in the System.ServiceModel.Discovery library.

A service can respond to probe messages by adding a well-known endpoint and service behavior to manage the endpoint. As it is standard practice in WCF, both can be set programmatically or via configuration files.

The UDP endpoint is a standard WCF endpoint. The next example shows the endpoint element adding a discovery endpoint. Specifically, the kind attribute (introduced with .NET 4.0) is used to identify the standard endpoints:

Example 1.
<services>
<service name="Example.Services.CustomerService"
behaviorConfiguration="DiscoveryBehavior">

... service application endpoint ...

<endpoint
name="udpDiscoveryEpt"
kind="udpDiscoveryEndpoint" />
</service>
</services>

Note that standard endpoints are configured machine-wide in the Machine.Config file. You can override the configuration in the Web.Config file, if necessary.

WCF 4.0 includes a service behavior to manage probe requests received on the discovery endpoint. This behavior is added to the service’s configuration, as shown here:

Example 2.
<behaviors>
<serviceBehaviors>
<behavior name="DiscoveryBehavior">
<serviceDiscovery />
</behavior>
</serviceBehaviors>
</behaviors>

A probe request includes a number of “find” criteria, a service contract, or a service’s URL scope. If a service matches all the find criteria, it responds with a FindMatch response containing its location, the matching criteria, and available metadata.

The probing service can retrieve the metadata from the response and evaluate it to determine how to handle the discovered service.

Shown here is an endpoint configuration with custom discovery metadata:

Example 3.
<endpoint
address=""
binding="basicHttpBinding"
contract="ICustomerService"
behaviorConfiguration="CustomMetadataBehavior" />
<endpointBehaviors>
<behavior name="CustomMetadataBehavior">
<endpointDiscovery enabled="true">
<extensions>
<MyCustomMetadata>Highly Scalable</MyCustomMetadata>
</extensions>
</endpointDiscovery>
</behavior>
</endpointBehaviors>
Other -----------------
- Windows 7 : Working with Network Files Offline (part 3) - Prohibiting a Network Folder from Being Made Available Offline & Encrypting Offline Files
- Windows 7 : Working with Network Files Offline (part 2) - Changing the Amount of Disk Space Used by Offline Files
- Windows 7 : Working with Network Files Offline (part 1) - Activating the Offline Files Feature & Making a File or Folder Available for Offline Use
- Windows 7 : Sharing Resources with the Network (part 2) - Monitoring Your Shared Resources
- Windows 7 : Sharing Resources with the Network (part 1) - Setting Sharing Options & Creating User Accounts for Sharing
- Windows 7 : Accessing a Shared Printer
- Windows 7 : Creating a Network Location for a Remote Folder
- Windows Vista: Windows Reliability and Performance Monitor and Task Manager
- Windows Vista: Configuring Internet Explorer 7.0 - Dynamic Security and Protected Mode
- Windows 7: Mapping a Network Folder to a Local Drive Letter
- SOA with .NET and Windows Azure: WCF Extensions - WCF Router (part 2) - Routing Configuration
- SOA with .NET and Windows Azure: WCF Extensions - WCF Router (part 1) - The RoutingService Class & Routing Contracts
- Windows 7: Accessing Shared Network Resources
- Windows 7: Managing Wireless Network Connections (part 4) - Creating User-Specific Wireless Connections
- Windows 7: Managing Wireless Network Connections (part 3) - Reordering Wireless Connections
- Windows 7: Managing Wireless Network Connections (part 2) - Working with Wireless Connection Properties
- Windows 7: Managing Wireless Network Connections (part 1) - Creating an Ad Hoc Wireless Network
- Windows7: Managing Network Connections (part 5) - Using a Network Connection to Wake Up a Sleeping Computer
- Windows7: Managing Network Connections (part 4) - Finding a Connection’s MAC Address
- Windows7: Managing Network Connections (part 3) - Setting Up a Static IP Address
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us